<?php
$this->breadcrumbs=array(
	'Messages'=>array('index'),
	'Manage',
);

$this->menu=array(
	array('label'=>'List Message', 'url'=>array('index')),
	array('label'=>'Create Message', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('message-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>
<div class="admin_table">
<h2>Manage Messages</h2>

<?php echo CHtml::link('Advanced Search','#',array('class'=>'search-button')); ?>
<div class="search-form" style="display:none">
<?php $this->renderPartial('_search',array(
	'model'=>$model,
)); ?>
</div><!-- search-form -->

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'message-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		
		'name',
		'email',
		'message',
	
		'created',
			array(
			'class'=>'CButtonColumn',
		'template' => '{remove}',
			'buttons'=>array(                         
                        'remove' => array(
                                'label'=>'Delete', // text label of the button
                                'url'=>"CHtml::normalizeUrl(array('/admin/Message/delete', 'id'=>\$data->id))",
                               'imageUrl'=>"/sitewed/images/delete.png",  // image URL of the button. If not set or false, a text link is used
                                'options' => array('class'=>'show', 'confirm'=>"Are you sure?"), // HTML options for the button
                        ),     
                      ),
		),
	),
)); ?>
</div>